package ihm;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import java.awt.Font;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class FenetreAjouterSoin extends JDialog implements ActionListener
{

	private final JPanel contentPanel = new JPanel();
	private JLabel lblDescriptionDuSoin;
	private JTextField txtDescriptionSoin;
	private JLabel lblCotDuSoin;
	private JTextField txtCoutSoin;
	private JButton btnEffacer;
	private JButton btnValider;
	private JButton btnAnnuler;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args)
	{
		try
		{
			FenetreAjouterSoin dialog = new FenetreAjouterSoin();
			dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
			dialog.setVisible(true);
		} catch (Exception e)
		{
			e.printStackTrace();
		}
	}

	/**
	 * Create the dialog.
	 */
	public FenetreAjouterSoin()
	{
		setBounds(100, 100, 882, 485);
		getContentPane().setLayout(new BorderLayout());
		contentPanel.setBounds(0, 0, 866, 447);
		contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
		getContentPane().add(contentPanel, BorderLayout.CENTER);
		contentPanel.setBackground(new Color(178, 200, 219));
		contentPanel.setLayout(null);
		
		lblDescriptionDuSoin = new JLabel("Description du soin :");
		lblDescriptionDuSoin.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblDescriptionDuSoin.setBounds(61, 106, 137, 28);
		contentPanel.add(lblDescriptionDuSoin);
		
		txtDescriptionSoin = new JTextField();
		txtDescriptionSoin.setBounds(208, 111, 298, 20);
		contentPanel.add(txtDescriptionSoin);
		txtDescriptionSoin.setColumns(10);
		
		lblCotDuSoin = new JLabel("Co\u00FBt du soin :");
		lblCotDuSoin.setFont(new Font("Tahoma", Font.BOLD, 12));
		lblCotDuSoin.setBounds(61, 180, 137, 20);
		contentPanel.add(lblCotDuSoin);
		
		txtCoutSoin = new JTextField();
		txtCoutSoin.setBounds(208, 181, 86, 20);
		contentPanel.add(txtCoutSoin);
		txtCoutSoin.setColumns(10);
		
		btnEffacer = new JButton("Effacer");
		btnEffacer.addActionListener(this);
		btnEffacer.setBounds(486, 262, 91, 23);
		contentPanel.add(btnEffacer);
		
		btnValider = new JButton("Valider");
		btnValider.addActionListener(this);
		btnValider.setBounds(612, 262, 91, 23);
		contentPanel.add(btnValider);
		
		btnAnnuler = new JButton("Annuler");
		btnAnnuler.addActionListener(this);
		btnAnnuler.setBounds(748, 262, 91, 23);
		contentPanel.add(btnAnnuler);
	}

	public void actionPerformed(ActionEvent evt) {

		if(evt.getSource()== this.btnAnnuler)
		{
			dispose();
		}
		if (evt.getSource()==this.btnEffacer)
		{
			this.txtDescriptionSoin.setText(" ");
			this.txtCoutSoin.setText(" ");
		}
		if(evt.getSource()== this.btnValider){
			
		}
	}
}
